﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YAPL.Language.Core.Types;
using YAPL.Util;
namespace YAPL.Language.Core.Lib.GlobalFunctions {
	public class Print : YAPLFunction {
		public Print() : base(FunctionNames.Print, GCL.Get(ClassNames.GlobalScope)) { }

		public override YAPLObject Call(Scope scope) {
			ParseScope(scope);
			var b = new StringBuilder();
			scope.Each(x => { if (x.Key != SELF_PARAMETER && x.Key != NAME_PARAMETER) b.Append(x.Value.ToYAPLString().StrValue); });
			Console.WriteLine(b.ToString());
			return UNDEFINED;
		}

		public override bool CanPrecompute {
			get {
				return false;
			}
		}
	}
}
